package com.april.pattern.creational.builder;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/06/22 21:00
 * @description 中华牌飞船的装配
 */
public class ZhAirShipDirector implements AirShipDirector {
    private AirShipBuilder airShipBuilder;

    public ZhAirShipDirector(AirShipBuilder airShipBuilder) {
        this.airShipBuilder = airShipBuilder;
    }

    @Override
    public AirShip decorateAirShip() {
        Engine engine = airShipBuilder.getEngine();
        EscapeTower escapeTower = airShipBuilder.getEscapeTower();
        OrbitalModule orbitModule = airShipBuilder.getOrbitModule();

        return new AirShip(engine, escapeTower, orbitModule);
    }
}
